/*
 * @Description: 流程部署相关接口
 * @Author: zhuoda
 * @Date: 2024-03-21
 */
import {postRequest, getRequest, putRequest, deleteRequest} from '/@/lib/axios';
export const deployApi = {
  // 查询流程部署列表
  listDeploy: (param) => {
    return getRequest('/flowable/deploy/list', param);
  },

  // 查询流程部署详细
  getDeploy: (definitionId) => {
    return getRequest(`/flowable/deploy/${definitionId}`);
  },

  // 删除流程部署
  delDeploy: (definitionIds) => {
    return deleteRequest(`/flowable/deploy/${definitionIds}`);
  },

  // 查询流程部署版本列表
  publishList: (param) => {
    return getRequest('/flowable/deploy/publishList', param);
  },

  // 激活或挂起流程
  changeState: (param) => {
    return putRequest(`/flowable/deploy/changeState?state=${param.state}&definitionId=${param.definitionId}`, param);  
  },

  // 读取xml文件
  getBpmnXml: (definitionId) => {
    return getRequest(`/flowable/deploy/bpmnXml/${definitionId}`)
  }

};
